From: Colin Walters Date: Mon, 14 Sep 2009 17:45:49 +0000 (-0400) Subject: Only enable internal commands if developer_tools is true X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10919 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2ddc7cf00f64e937c8c2798b31c46d25734b7967;p=gnome-shell.git Only enable internal commands if developer_tools is true 'r' is a bit too accidentally-hittable for outside of developer usage. However it will still be enabled when developer_tools is true. https://bugzilla.gnome.org/show_bug.cgi?id=595116 --- diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 67d5b8b4f..9e3209288 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -34,6 +34,13 @@ RunDialog.prototype = { _init : function() { this._isOpen = false; + let gconf = Shell.GConf.get_default(); + gconf.connect('changed', Lang.bind(this, function (gconf, key) { + if (key == 'development_tools') + this._enableInternalCommands = gconf.get_bool('development_tools'); + })); + this._enableInternalCommands = gconf.get_boolean('development_tools'); + this._internalCommands = { 'lg': Lang.bind(this, function() { // Run in an idle to avoid recursive key grab problems @@ -142,7 +149,11 @@ RunDialog.prototype = { }, _run : function(command) { - let f = this._internalCommands[command]; + let f; + if (this._enableInternalCommands) + f = this._internalCommands[command]; + else + f = null; if (f) { f(); } else if (command) {